﻿using System;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using Kotonoha.Client.Settings;
using Kotonoha.Client.Synch;
using Kotonoha.Client.UI;
using Microsoft.Win32;

namespace Kotonoha.Client
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [MTAThread]
        static void Main()
        {
            MarkRegistry();
            SynchronizationManager.Start(".");
            Application.Run(new MainForm());
        }

        private static void MarkRegistry() {
            ClientSettings set = ClientSettings.Instance;
            DirectoryInfo info = new DirectoryInfo(@".");
            if (!string.Equals(set.InstallDir, info.FullName)) {
                set.InstallDir = info.FullName;
                set.save();
            }
        }
    }
}